package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

/**
 * @author liyang
 * @version 1.0
 * @package io
 * @file OSWDemo.java
 * @description
 * @time 2024-03-29 22:18
 */
public class OSWDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("osw.text");
        //OutputStreamWriter osw = new OutputStreamWriter(fos);
        /*
        不用系统的，指定字符集来实现跨平台
         */
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        osw.write("靠恁姨");
        System.out.println("写出完毕");
        osw.close();

    }
}
